import { observer } from 'mobx-react-lite'

import { useEffect, useState } from 'react'

function MessageItem() {
  const [data, setData] = useState({})

  useEffect(() => {
    // getCommunicateVO({ current: 1, pageSize: 5 }).then((r) => {
    //   setData(r)
    //   console.log('**********', r)
    // })
  }, [])

  // const btn = (record: Dialogue) => {
  //   console.log(record)
  //   console.log(record.user.openid)
  //   sessionMessage.setToOpenId(record.user.openid)
  //   sessionMessage.changeChat(record)
  // }
  return (
    <>
      {/* <div className={style.content_header}>
        <img src="" alt="" className={style.logo} /> 
        <Input placeholder="default size" prefix={<SearchOutlined />} className={style.input} />
      </div>
      <div className={style.scrollbar}>
        {data.records?.map((item) => (
          // eslint-disable-next-line react/jsx-key
          <div className={style.content} onClick={() => sessionMessage.changeChat(item)}>
            <img className={style.headImg} src={item.user.avatar} />
            <div className={style.info_area}>
              <span className={style.nickname}>{item.user.nickname}</span>
              <span className={style.message1}>{item.lastMessage}</span>
              <div className={style.dto}>{item.unreadTotal}</div>
            </div>
            <span className={style.update_time}>{item.updateTime}</span>
          </div>
        ))}
      </div> */}
    </>
  )
}

export default observer(MessageItem)
